<?php
header("content-type:text/html;charset=utf-8");
date_default_timezone_set('PRC');
session_start();

define('PATH',str_replace('\\','/',dirname(__FILE__)));


include PATH.'/../func.inc.php';
include PATH.'/../config.php';

//连接数据库
$link = mysql_connect(HOST,USER,PWD);

if(!$link) exit(mysql_error);

mysql_select_db(DB);

mysql_set_charset(CHAR);

$url = APP.'/admin/index.php';
$_SESSION['source'] = $url;

//验证用户是否可管理后台

$i = $_SESSION['home']['class'] == null? 2: $_SESSION['home']['class'] ;

if($i > 1 ){
	echo '<meta http-equiv="Refresh" content="0;url='.APP.'/login.php" />';
	exit;
}
?>
